<%@ page import="cn.wolfcode.domain.File" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.wolfcode.service.IUserService" %>
<%@ page import="cn.wolfcode.service.Impl.UserServiceImpl" %>
<%@ page import="cn.wolfcode.domain.User" %>
<%--
  Created by IntelliJ IDEA.
  User: 孙晓萌
  Date: 2021/8/13
  Time: 20:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="/list" method="post">
    <h3>欢迎：${username}</h3>
    <a href="/chaxunServlet/zhuxiao">注销</a>
    <a href="/chaxunServlet/input2">添加</a><br>
    <p>账号：${u.username}</p>
    <p>密码：${u.password}</p>
    <p>年龄：${u.age}</p>
    <a href="/chaxunServlet/xiugaixinxi">修改信息</a>
    <table border="1" cellspacing="0" cellpadding="0" width="80%" style="text-align: center">
        <tr>
            <th>编号</th>
            <th>文件名</th>
            <th>操作</th>
        </tr>
        <c:forEach var="file" items="${list}" varStatus="status">
            <tr class="yangshi">
               <td>${file.id}</td>
                <td>${file.filename}</td>
                <td>
                    <a href="/chaxunServlet/input?id=${file.id}">编辑</a>
                    <a href="/chaxunServlet/delete?id=${file.id}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</form>
<script type="text/javascript">
    window.onload = function () {
        var trClzs = document.getElementsByClassName("yangshi");
        for (var i = 0; i < trClzs.length; i++) {
            trClzs[i].onmouseover = function () {
                this.style.backgroundColor = "#FF7300";
            }
            trClzs[i].onmouseout = function () {
                this.style.backgroundColor = "";
            }
        }
    }

    function changePage() {
        document.forms[0].submit();
    }
</script>
</body>
</html>
